
package com.xbongbong.paas.log.entity;

import com.xbongbong.paas.toolbox.util.DateUtil;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;

import java.io.Serializable;

/**
 * 日志详情实体,对应mongodb表
 * @author kaka
 * @date 2018/9/14
 * @since v1.0
 * @version v1.0
 */
@Data
@Document(collection = "operate_detail_log")
public class OperateDetailLogEntity implements Serializable {

	private static final long serialVersionUID = 2885165020028599991L;

	//========== properties ==========

	/**
	 * 主键
	 */
	@Id
	private String id;
	/**
	 * 公司ID
	 */
	private String corpid;
	/**
	 * 关联日志表ID
	 */
	private String operateLogId;
	/**
	 * 操作内容，数组型字符串：[{"tab": "", "title": "", "content": ""}]
	 * 直接文字描述操作内容，如导入、批量操作等直接记录导入、批量操作的数据内容
	 */
	private String infoArr;
	/**
	 * 更改详情（字段名、更改前、更改后），数组型字符串：[{"name": "", "updataBefore": "", "updataAfter": "", "": ""}]
	 * 更新的，则各个key为：name、updataBefore、updataAfter等
	 */
	private String detailArr;
	/**
	 * 添加时间
	 */
	private Integer addTime;

	/**
	 * 复杂详情
	 */
	private Integer complexDetail;

	public OperateDetailLogEntity() {
		this .addTime = DateUtil.getInt();
	}

	public OperateDetailLogEntity(String corpid, String operateLogId) {
		this();
		this.corpid = corpid;
		this.operateLogId = operateLogId;
	}
}

